package com.felight.set;

/**
 * Set which accepts Student object is created.
 */
import java.util.HashSet;
import java.util.LinkedHashSet;

public class SetDemo {
	public static void main(String[] args) {
		Student s1 = new Student("soumya", 95);// Student objects are created
		Student s2 = new Student("megha", 94);
		Student s3 = new Student("megha", 96);
		Student s4 = new Student("yashu", 99);
		LinkedHashSet<Student> set = new LinkedHashSet<Student>();// LinkedHashset
																	// is
																	// created
		// HashSet<Student>set=new HashSet<Student>();
		set.add(s1); // student objects are added into the list
		set.add(s2);
		set.add(s3);
		set.add(s4);
		for (Student s : set) {
			System.out.println(s.name + " " + s.perc + " " + s.hashCode());
		}
	}
}
